package com.pj.wisdomlogistics.mvp.presenter;


import com.pj.wisdomlogistics.entity.MyApplySimpleInfo;
import com.pj.wisdomlogistics.mvp.contract.MyApplyContract;
import com.pj.wisdomlogistics.mvp.frame.ActivityPresenter;
import com.pj.wisdomlogistics.mvp.model.MyApplyModel;
import com.pj.wisdomlogistics.rx.FilterSubscriber;


public class MyApplyPresenter extends ActivityPresenter<MyApplyModel,MyApplyContract.View> implements MyApplyContract.Presenter{
    public static final String TAG = "MyApplyPresenter";

    @Override
    public void myApply(String userID, int applyType, int timeType, int state, int pageIndex, int pageNumber) {
        addSubscription(getModel().myApply(userID, applyType, timeType, state, pageIndex, pageNumber), new FilterSubscriber<MyApplySimpleInfo>() {
            @Override
            public void onNext(MyApplySimpleInfo mMyApplySimpleInfos) {
                getView().showSuccess(mMyApplySimpleInfos);
            }

            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().showError(errorMsg);
            }

        });
    }
}
